package com.jrzh.mvc.convert.sys;

import com.jrzh.common.exception.ProjectException;
import com.jrzh.common.utils.ReflectUtils;
import com.jrzh.framework.base.convert.BaseConvertI;
import com.jrzh.mvc.model.sys.EmailSendModel;
import com.jrzh.mvc.view.sys.EmailSendView;

public class EmailSendConvert implements BaseConvertI<EmailSendModel, EmailSendView> {

	@Override
	public EmailSendModel addConvert(EmailSendView view) throws ProjectException {
		EmailSendModel model = new EmailSendModel();
		ReflectUtils.copySameFieldToTarget(view, model);
		return model;
	}

	@Override
	public EmailSendModel editConvert(EmailSendView view, EmailSendModel model) throws ProjectException {
		ReflectUtils.copySameFieldToTargetFilter(view, model, new String[]{"createBy", "createTime"});
		return model;
	}

	@Override
	public EmailSendView convertToView(EmailSendModel model) throws ProjectException {
		EmailSendView view = new EmailSendView();
		ReflectUtils.copySameFieldToTarget(model, view);
		return view;
	}

}
